<?php
include 'includes/inc_header_list.php';
include 'includes/inc_header.php';
include 'includes/inc_menu.php';
?>
<div id='cols' class='box'><?php include 'includes/left-column.php' ?></div>
<div id='content' class='box'>
    <h1>Filiação</h1>
    <p id='btn-create' class='box'><a href='filiacao_cad.php'><span>Adicionar Filiação</span></a></p>
    <div class='fix'></div>
    <table width="100%"  id="listagem">
        <thead>
            <tr>
                <th scope='col'>Nome Pai</th>
                <th scope='col'>Nome Mãe</th>
                <th scope='col' colspan='2'>Ações</th>
            </tr>
        </thead>
        <tfoot>
        </tfoot>
        <?php
           require_once 'Model/Filiacao.php';
           require_once 'Model/DAO/ConnectionPDO.php';
           require_once 'Model/DAO/FiliacaoDAO.php';
           $filiacaoDAO = new FiliacaoDAO();
           foreach ($filiacaoDAO->getAll() as $linhas):
         ?>
        <tbody>
          <tr>
            <td><?= utf8_encode($linhas['pai']) ?></td>
            <td><?= utf8_encode($linhas['mae']) ?></td>
            <td class='t-center'>
                <a href='filiacao_edit.php?IDFiliacao=<?=$linhas['IDFiliacao']?>'><img src='img/design/ico-edit.gif' class='ico' alt='Edit' /></a>
                <a href='filiacao_del.php?IDFiliacao=<?=$linhas['IDFiliacao']?>'><img src='img/design/ico-delete.gif' class='ico' alt='Delete' /></a>
            </td>
          </tr>
        </tbody>
        <?php endforeach; ?>
    </table>
</div>
<?php include 'includes/inc_footer.php'; ?>